import request from '@/utils/request';
import type { BaseResponse, UploadParams, UploadResponseData } from './model/model';

// 通用文件上传
export const uploadFile = (params: UploadParams) => {
  const formData = new FormData();
  formData.append('uploadFile', params.uploadFile);

  return request.post<BaseResponse<UploadResponseData>>('/kf/upload', formData, {
    headers: { 'Content-Type': 'multipart/form-data' }
  });
};
